import os
script_dir = os.path.dirname(os.path.abspath(__file__))
base_dir = os.path.abspath(os.path.join(script_dir, "../packages"))

if not os.path.exists(base_dir):
    print(f"目录不存在: {base_dir}")
    exit(1)

for name in os.listdir(base_dir):
    folder = os.path.join(base_dir, name)
    if os.path.isdir(folder):
        pkg_json = os.path.join(folder, "package.json")
        if os.path.exists(pkg_json):
            print(f"正在删除: {pkg_json}")
            os.remove(pkg_json)